package com.umedcn.controller;

import com.alibaba.fastjson.JSONObject;
import com.umedcn.dao.PostDao;
import com.umedcn.model.Post;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by jiangadam on 2017/8/3.
 */
@RestController
@RequestMapping("/post")
public class PostController {

    @Autowired
    private PostDao postDao;

    @RequestMapping("/getpost")
    public JSONObject getPost(){
        Post post = postDao.getPosts(1);

        JSONObject data = new JSONObject();
        data.put("post", post);
        return data;
    }
}
